﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WaveMaster.Holidays.Club.SQL
{
    public class MemberTypeSQL
    {
        public static string GetAllMemberType()
        {
            string sql = "select * from member_type";
            return sql;
        }
        public static string InsertMemberType()
        {
            string sql = @"INSERT INTO member_type
           (
            m_member_type_code
           ,m_member_type_name
            ,m_price
            ,m_discount
            ,m_remarks
           ,m_cretnDate            
            ,m_cretnBy
            ,m_modfctnDate
            ,m_modfctnBy
            )
     VALUES
           ( ?m_member_type_code
           ,?m_member_type_name
            ,?m_price
            ,?m_discount
            ,?m_remarks
           ,?m_cretnDate            
            ,?m_cretnBy
            ,?m_modfctnDate
            ,?m_modfctnBy)";
            return sql;
        }
        public static string UpdateMemberType()
        {
            string sql = @"UPDATE member_type
           SET
            m_member_type_code = ?m_member_type_code
           ,m_member_type_name =?m_member_type_name
            ,m_price=?m_price
            ,m_discount=?m_discount
            ,m_remarks=?m_remarks
            ,m_modfctnDate=?m_modfctnDate
            ,m_modfctnBy=?m_modfctnBy
              WHERE m_member_type_id = ?m_member_type_id";
            return sql;
        }
        public static string GetMemberTypeByID()
        {
            string sql = "select * from member_type where m_member_type_id = ?m_member_type_id ";
            return sql;
        }
        public static string DeleteMemberTypeByID()
        {
            return @"DELETE FROM member_type
      WHERE m_member_type_id = ?m_member_type_id";
        }
        public static string SearchMemberTypeByCodeName(string p)
        {
            string sql = "select * from member_type WHERE concat(m_member_type_code,m_member_type_name) like '%" + p + "%'";
            return sql;
        }
    }
}
